import Vue from "vue";
import Router from "vue-router";
import Index from "@/pages/home/Index";
import ShowRoom from "@/pages/showRoom/ShowRoom";
import Department from "@/pages/department/Department";
import Login from "@/pages/login/Login";
import Record from "@/pages/record/Record";
import Inform from "@/pages/inform/Inform";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "Index",
      meta: {
        requireAuth: true
      },
      component: Index
    },
    {
      path: "/index",
      name: "Index",
      meta: {
        requireAuth: true
      },
      component: Index
    },
    {
      path: "/meetingRoom",
      name: "ShowRoom",
      meta: {
        requireAuth: true
      },
      component: ShowRoom
    },
    {
      path: "/department",
      name: "Department",
      meta: {
        requireAuth: true
      },
      component: Department
    },
    {
      path: "/record",
      name: "Record",
      meta: {
        requireAuth: true
      },
      component: Record
    },
    {
      path: "/inform",
      name: "Inform",
      meta: {
        requireAuth: true
      },
      component: Inform
    },
    {
      path: "/login",
      name: "Login",
      component: Login
    },
    {
      path: "/404",
      name: "Error404",
      component: resolve => require(["../common/error/404.vue"], resolve),
      meta: { title: "404" }
    },
    {
      path: "/403",
      name: "Error403",
      component: resolve => require(["../common/error/403.vue"], resolve),
      meta: { title: "403" }
    }
  ]
});
